package com.machine.filling.net.ws.network;

import android.util.Log;

import com.machine.filling.net.ws.req.WsGetErWeiMaReq;
import com.machine.filling.net.ws.req.WsReqAdList;
import com.machine.filling.net.ws.req.WsReqCheckOrderPayState;
import com.machine.filling.net.ws.req.WsReqCheckVersion;
import com.machine.filling.net.ws.req.WsReqCreateNewOrder;
import com.machine.filling.net.ws.req.WsReqCreatePreOrder;
import com.machine.filling.net.ws.req.WsReqGetCardFuelingOrder;
import com.machine.filling.net.ws.req.WsReqGetCardInfo;
import com.machine.filling.net.ws.req.WsReqGetGunInfo;
import com.machine.filling.net.ws.req.WsReqGetPreOrderInfo;
import com.machine.filling.net.ws.req.WsReqPayCard;
import com.machine.filling.net.ws.req.WsReqPayCash;
import com.machine.filling.net.ws.req.WsReqUnLockOrder;
import com.machine.filling.net.ws.req.WsReqUpdateGunState;
import com.machine.filling.net.ws.req.WsReqUpdateWorkMode;
import com.machine.filling.util.Common;
import com.machine.filling.util.DateUtils;

/**
 * Created by Administrator on 2018/3/1 0001.
 */

public class WsReqParam {
    private static final String TAG = "WsReqParam";
    private String token;
    private static WsReqParam instance;

    private WsReqParam(String token) {
        this.token = token;
    }

    public static WsReqParam getInstance(String token) {
        if (instance == null) {
            instance = new WsReqParam(token);
        }
        return instance;
    }

    /**
     * 得到  请求油枪信息 的请求参数
     *
     * @return
     */
    public WsReqGetGunInfo getGunInfoRequestJson_1000(String machineId) {
        WsReqGetGunInfo wsReq = new WsReqGetGunInfo();
        wsReq.setToken(token);
        wsReq.setMachineId(machineId);
        Log.d(TAG, "获取油枪信息[1000]");
        return wsReq;
    }

    /**
     * 获取油卡信息 请求参数
     *
     * @param machineId      油机id
     * @param gunId        油枪id
     * @param cardNum      油卡编号
     * @param encryCardNum 油卡加密卡号
     */
    public WsReqGetCardInfo getCardInfoRequest_1001(String machineId,String gunId, String cardNum, String encryCardNum) {
        WsReqGetCardInfo wsReq = new WsReqGetCardInfo();
        wsReq.setToken(token);
        wsReq.setMachineId(machineId);
        wsReq.setCardNum(cardNum);
        wsReq.setGunId(gunId);
        wsReq.setEncryCarNum(encryCardNum);
        Log.d(TAG, "获取油卡信息[1001]");
        return wsReq;
    }

    /**
     * 获取预约订单信息
     *
     * @param sellerId 油站id
     * @param gunId    油枪id
     * @param orderNum 订单编号
     */
    public WsReqGetPreOrderInfo getPreOrderInfoRequest_1002(String sellerId, String gunId, String orderNum) {
        WsReqGetPreOrderInfo wsReq = new WsReqGetPreOrderInfo();
        wsReq.setToken(token);

        wsReq.setSellerId(sellerId);
        wsReq.setGunId(gunId);
        wsReq.setOrderNum(orderNum);
        Log.d(TAG, "获取预约订单信息WS请求==> ");
        return wsReq;
    }

    /**
     * 更新油枪状态
     *
     * @param gunId 油枪id
     * @param state 油枪状态
     */
    public WsReqUpdateGunState getUpdateGunStateRequest_1003(String gunId, String state) {
        WsReqUpdateGunState wsReq = new WsReqUpdateGunState();
        wsReq.setToken(token);

        wsReq.setGunId(gunId);
        wsReq.setState(state);
        Log.d(TAG, "更新油枪状态WS请求==>");
        return wsReq;
    }

    /**
     * 检查更新
     *
     * @param machineId 油机id
     */
    public WsReqCheckVersion getCheckVersionRequest_1004(String machineId) {
        WsReqCheckVersion wsReq = new WsReqCheckVersion();
        wsReq.setToken(token);

        wsReq.setMachineId(machineId);
        return wsReq;
    }

    /**
     * 获取创建订单请求 参数
     *
     * @param token
     * @param amount
     * @param machineNum
     * @param discountPrice
     * @param orderNum
     * @param oilPotId
     * @param oilGunNum
     * @param oilGunId
     * @param sellerId
     * @param machineId
     * @param oilCardId
     * @param price
     * @param mlAmount  *1000
     * @param oilTypeName
     * @param oilTypeId
     * @param cuPrice
     * @param oilPotNum
     * @param isNormal  1正常 2异常
     * @param createD  加油时间
     * @return
     */
    public WsReqCreateNewOrder getCreteOrder_Request_1005(
            String token, String amount, String machineNum, String discountPrice, String orderNum,
            String oilPotId, String oilGunNum, String oilGunId, String sellerId, String machineId,
            String oilCardId, String price, String mlAmount, String oilTypeName, String oilTypeId,
            String cuPrice, String oilPotNum,String isNormal,String machineFlowNum,String createD) {
        WsReqCreateNewOrder wsReq = new WsReqCreateNewOrder();
        wsReq.setToken(token);
        wsReq.setAmount(amount);
        wsReq.setMachineNum(machineNum);
        wsReq.setCreateD(createD);
        wsReq.setDiscountPrice(discountPrice);
        wsReq.setOrderNum(orderNum);
        wsReq.setOilPotId(oilPotId);
        wsReq.setOilGunNum(oilGunNum);
        wsReq.setOilGunId(oilGunId);
        wsReq.setSellerId(sellerId);
        wsReq.setMachineId(machineId);
        wsReq.setOilCardId(oilCardId);
        wsReq.setPrice(price);
        wsReq.setMlAmount(mlAmount);
        wsReq.setOilTypeName(oilTypeName);
        wsReq.setOilTypeId(oilTypeId);
        wsReq.setCuPrice(cuPrice);
        wsReq.setOilPotNum(oilPotNum);
        wsReq.setIsNormal(isNormal);
        wsReq.setMachineFlowNum(machineFlowNum);
        return wsReq;
    }

    /**
     *  预约订单 提交
     * @param token
     * @param orderNum
     * @param oilGunId
     * @param machineId
     * @param oilPotId
     * @param oilGunNum
     * @param oilTypeId
     * @param usePrice
     * @param price
     * @param mlAmount
     * @param machineNum
     * @param oilTypeName
     * @param cuPrice
     * @param oilPotNum
     * @param machineFlowNum
     * @param isNormal
     * @param usedDStr
     * @return
     */
    public WsReqCreatePreOrder getCreatePreOrder_Request_1009(
            String token, String orderNum, String oilGunId, String machineId,
            String oilPotId, String oilGunNum, String oilTypeId,
            String usePrice, String price, String mlAmount, String machineNum,
            String oilTypeName, String cuPrice, String oilPotNum,String machineFlowNum,
            String isNormal,String usedDStr) {
        WsReqCreatePreOrder wsReq = new WsReqCreatePreOrder();
        wsReq.setToken(token);
        wsReq.setOrderNum(orderNum);
        wsReq.setOilGunId(oilGunId);
        wsReq.setMachineId(machineId);
        wsReq.setOilPotId(oilPotId);
        wsReq.setOilGunNum(oilGunNum);
        wsReq.setOilTypeId(oilTypeId);
        wsReq.setUsePrice(usePrice);
        wsReq.setPrice(price);
        wsReq.setMlAmount(mlAmount);
        wsReq.setMachineNum(machineNum);
        wsReq.setOilTypeName(oilTypeName);
        wsReq.setCuPrice(cuPrice);
        wsReq.setOilPotNum(oilPotNum);
        wsReq.setMachineFlowNum(machineFlowNum);
        wsReq.setIsNormal(isNormal);
        wsReq.setUsedDStr(usedDStr);
        return wsReq;
    }

    /**
     * 获取油卡支付的订单
     * @param token
     * @param machineId
     * @param orderNum
     * @return
     */
    public WsReqGetCardFuelingOrder getCardFuelingOrder_Request_1010(String token, String machineId, String orderNum){
        WsReqGetCardFuelingOrder wsReq = new WsReqGetCardFuelingOrder();
        wsReq.setToken(token);
        wsReq.setMachineId(machineId);
        wsReq.setOrderNum(orderNum);
        return wsReq;
    }

    /**
     * 现金支付
     * @param token
     * @param machineId
     * @param orderNum
     * @return
     */
    public WsReqPayCash payCash_Request_1011(String token, String machineId, String orderNum){
        WsReqPayCash wsReq = new WsReqPayCash();
        wsReq.setToken(token);
        wsReq.setMachineId(machineId);
        wsReq.setOrderNum(orderNum);
        return wsReq;
    }

    /**
     * 油价加油的油卡支付
     * @param token
     * @param machineId
     * @param orderNum
     * @return
     */
    public WsReqPayCard payCard_Request_1012(String token, String machineId, String orderNum){
        WsReqPayCard wsReq = new WsReqPayCard();
        wsReq.setToken(token);
        wsReq.setMachineId(machineId);
        wsReq.setOrderNum(orderNum);
        return wsReq;
    }

    /**
     * 获取广告列表
     * @param token
     * @param machineId
     * @return
     */
    public WsReqAdList getAdList_1013(String token, String machineId){
        WsReqAdList wsReq = new WsReqAdList();
        wsReq.setToken(token);
        wsReq.setMachineId(machineId);
        return wsReq;
    }

    /**
     * 获取二维码
     * @param token
     * @param orderNum
     * @param sellerId
     * @param machineId
     * @return
     */
    public WsGetErWeiMaReq getErWeiMa_1006(String token,String orderNum,String sellerId,String machineId){
        WsGetErWeiMaReq wsReq = new WsGetErWeiMaReq();
        wsReq.setToken(token);
        wsReq.setOrderNum(orderNum);
        wsReq.setSellerId(sellerId);
        wsReq.setMachineId(machineId);
        return wsReq;
    }

    /**
     * 获取支付宝二维码
     * @param token
     * @param orderNum
     * @param sellerId
     * @param machineId
     * @return
     */
    public WsGetErWeiMaReq getZFBErWeiMa_1006(String token,String orderNum,String sellerId,String machineId){
        WsGetErWeiMaReq wsReq = new WsGetErWeiMaReq();
        wsReq.setAction(Common.ACT_GET_ZFB_ERWEIMA_1006);
        wsReq.setToken(token);
        wsReq.setOrderNum(orderNum);
        wsReq.setSellerId(sellerId);
        wsReq.setMachineId(machineId);
        return wsReq;
    }

    /**
     * 获取微信二维码
     * @param token
     * @param orderNum
     * @param sellerId
     * @param machineId
     * @return
     */
    public WsGetErWeiMaReq getWXErWeiMa_1015(String token,String orderNum,String sellerId,String machineId){
        WsGetErWeiMaReq wsReq = new WsGetErWeiMaReq();
        wsReq.setAction(Common.ACT_GET_WX_ERWEIMA_1015);
        wsReq.setToken(token);
        wsReq.setOrderNum(orderNum);
        wsReq.setSellerId(sellerId);
        wsReq.setMachineId(machineId);
        return wsReq;
    }

    /**
     * 查询订单支付状态
     * @param token
     * @param orderNum
     * @param machineId
     * @return
     */
    public WsReqCheckOrderPayState checkOrderPayState_1010(String token, String orderNum, String machineId){
        WsReqCheckOrderPayState wsReq = new WsReqCheckOrderPayState();
        wsReq.setToken(token);
        wsReq.setOrderNum(orderNum);
        wsReq.setMachineId(machineId);
        return wsReq;
    }

    /**
     * 解锁预约订单
     * @param token
     * @param orderNum
     * @param machineId
     * @return
     */
    public WsReqUnLockOrder unLockOrder_1014(String token, String orderNum, String machineId ){
        WsReqUnLockOrder wsReq = new WsReqUnLockOrder();
        wsReq.setToken(token);
        wsReq.setOrderNum(orderNum);
        wsReq.setMachineId(machineId);
        return wsReq;
    }

    /**
     * 更新工作模式
     * @param token
     * @param gunId
     * @param workType
     * @return
     */
    public WsReqUpdateWorkMode updateWorkMode_1018(String token, String gunId, String workType ){
        WsReqUpdateWorkMode wsReq = new WsReqUpdateWorkMode();
        wsReq.setToken(token);
        wsReq.setGunId(gunId);
        wsReq.setWorkType(workType);
        return wsReq;
    }
}
